*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: TABLE G1 (Online Appendix)

***************************

cd ""

putexcel set "Tables/G1", modify 

global horizon 6 

************ PREPARE DATASET **********

run "Do files/Clean dataset"

************ ANALYSIS **********

forvalues s = 2/4 {
mat mat`s' = J(6,$horizon,.)

* Baseline
forvalues i= 1/$horizon {
quietly reghdfe  Y`i' r`s' l1Y l2Y l3Y l4Y l1r`s' l2r`s' l3r`s' l4r`s' t`s' ${f`i'`s'}, absorb(id_cross_section i.year#id_country i.year#id_industry) cluster(ifscode year) nocons
matrix results = r(table)
mat mat`s'[1,`i'] = results[1,1]
mat mat`s'[2,`i'] = results[2,1]
mat mat`s'[3,`i'] = results[4,1]
mat mat`s'[4,`i'] = e(N)
mat mat`s'[5,`i'] = e(r2)
}
}

************ SAVE OUTPUT **********

putexcel B4=matrix(mat2)
putexcel B12=matrix(mat3)
putexcel B20=matrix(mat4)
